#include <iostream>
using namespace std;

namespace my
{
	template<class Iterator,class Ref,class Ptr>
class ReverseIterator
{
public:
	typedef ReverseIterator<Iterator, Ref, Ptr> self;
	ReverseIterator(Iterator _it)
		:_it(it)
	{}

	self& operator++()
	{
		_it--;
		return *this;
	}

	self& operator--()
	{
		_it++;
		return *this;
	}

	Ref operator*()
	{
		Iterator tmp = _it;
		tmp--;
		return *tmp;
	}

	Ptr operator->()
	{
		return &(operator*());
	}

	bool operator!=(const self& s )
	{
		return _it != s._it;
	}
private:
	Iterator _it;
};
}
